using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;

namespace Adex
{
	/// <summary>
	/// Strongly-typed collection for the ProdVersion class.
	/// </summary>
	[Serializable]
	public partial class ProdVersionCollection : ActiveList<ProdVersion, ProdVersionCollection> 
	{	   
		public ProdVersionCollection() {}

	}

	/// <summary>
	/// This is an ActiveRecord class which wraps the ProdVersion table.
	/// </summary>
	[Serializable]
	public partial class ProdVersion : ActiveRecord<ProdVersion>
	{
		#region .ctors and Default Settings
		
		public ProdVersion()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}

		
		private void InitSetDefaults() { SetDefaults(); }

		
		public ProdVersion(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}

		public ProdVersion(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}

		 
		public ProdVersion(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}

		
		protected static void SetSQLProps() { GetTableSchema(); }

		
		#endregion
		
		#region Schema and Query Accessor
		public static Query CreateQuery() { return new Query(Schema); }

		
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}

		}

		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("ProdVersion", TableType.Table, DataService.GetInstance("Adex"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarProdVersionID = new TableSchema.TableColumn(schema);
				colvarProdVersionID.ColumnName = "ProdVersionID";
				colvarProdVersionID.DataType = DbType.Int32;
				colvarProdVersionID.MaxLength = 0;
				colvarProdVersionID.AutoIncrement = true;
				colvarProdVersionID.IsNullable = false;
				colvarProdVersionID.IsPrimaryKey = true;
				colvarProdVersionID.IsForeignKey = false;
				colvarProdVersionID.IsReadOnly = false;
				colvarProdVersionID.DefaultSetting = @"";
				colvarProdVersionID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProdVersionID);
				
				TableSchema.TableColumn colvarProdVersionCode = new TableSchema.TableColumn(schema);
				colvarProdVersionCode.ColumnName = "ProdVersionCode";
				colvarProdVersionCode.DataType = DbType.Int32;
				colvarProdVersionCode.MaxLength = 0;
				colvarProdVersionCode.AutoIncrement = false;
				colvarProdVersionCode.IsNullable = false;
				colvarProdVersionCode.IsPrimaryKey = false;
				colvarProdVersionCode.IsForeignKey = false;
				colvarProdVersionCode.IsReadOnly = false;
				colvarProdVersionCode.DefaultSetting = @"";
				colvarProdVersionCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProdVersionCode);
				
				TableSchema.TableColumn colvarProdVersionName = new TableSchema.TableColumn(schema);
				colvarProdVersionName.ColumnName = "ProdVersionName";
				colvarProdVersionName.DataType = DbType.String;
				colvarProdVersionName.MaxLength = 255;
				colvarProdVersionName.AutoIncrement = false;
				colvarProdVersionName.IsNullable = true;
				colvarProdVersionName.IsPrimaryKey = false;
				colvarProdVersionName.IsForeignKey = false;
				colvarProdVersionName.IsReadOnly = false;
				colvarProdVersionName.DefaultSetting = @"";
				colvarProdVersionName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProdVersionName);
				
				TableSchema.TableColumn colvarBrandID = new TableSchema.TableColumn(schema);
				colvarBrandID.ColumnName = "BrandID";
				colvarBrandID.DataType = DbType.Int32;
				colvarBrandID.MaxLength = 0;
				colvarBrandID.AutoIncrement = false;
				colvarBrandID.IsNullable = true;
				colvarBrandID.IsPrimaryKey = false;
				colvarBrandID.IsForeignKey = true;
				colvarBrandID.IsReadOnly = false;
				colvarBrandID.DefaultSetting = @"";
				
					colvarBrandID.ForeignKeyTableName = "Brand";
				schema.Columns.Add(colvarBrandID);
				
				TableSchema.TableColumn colvarProductID = new TableSchema.TableColumn(schema);
				colvarProductID.ColumnName = "ProductID";
				colvarProductID.DataType = DbType.Int32;
				colvarProductID.MaxLength = 0;
				colvarProductID.AutoIncrement = false;
				colvarProductID.IsNullable = true;
				colvarProductID.IsPrimaryKey = false;
				colvarProductID.IsForeignKey = true;
				colvarProductID.IsReadOnly = false;
				colvarProductID.DefaultSetting = @"";
				
					colvarProductID.ForeignKeyTableName = "Product";
				schema.Columns.Add(colvarProductID);
				
				TableSchema.TableColumn colvarFullVideo = new TableSchema.TableColumn(schema);
				colvarFullVideo.ColumnName = "FullVideo";
				colvarFullVideo.DataType = DbType.Boolean;
				colvarFullVideo.MaxLength = 0;
				colvarFullVideo.AutoIncrement = false;
				colvarFullVideo.IsNullable = false;
				colvarFullVideo.IsPrimaryKey = false;
				colvarFullVideo.IsForeignKey = false;
				colvarFullVideo.IsReadOnly = false;
				
						colvarFullVideo.DefaultSetting = @"((0))";
				colvarFullVideo.ForeignKeyTableName = "";
				schema.Columns.Add(colvarFullVideo);
				
				TableSchema.TableColumn colvarShortVideo = new TableSchema.TableColumn(schema);
				colvarShortVideo.ColumnName = "ShortVideo";
				colvarShortVideo.DataType = DbType.Boolean;
				colvarShortVideo.MaxLength = 0;
				colvarShortVideo.AutoIncrement = false;
				colvarShortVideo.IsNullable = false;
				colvarShortVideo.IsPrimaryKey = false;
				colvarShortVideo.IsForeignKey = false;
				colvarShortVideo.IsReadOnly = false;
				
						colvarShortVideo.DefaultSetting = @"((0))";
				colvarShortVideo.ForeignKeyTableName = "";
				schema.Columns.Add(colvarShortVideo);
				
				TableSchema.TableColumn colvarFullVideoFile = new TableSchema.TableColumn(schema);
				colvarFullVideoFile.ColumnName = "FullVideoFile";
				colvarFullVideoFile.DataType = DbType.String;
				colvarFullVideoFile.MaxLength = 100;
				colvarFullVideoFile.AutoIncrement = false;
				colvarFullVideoFile.IsNullable = true;
				colvarFullVideoFile.IsPrimaryKey = false;
				colvarFullVideoFile.IsForeignKey = false;
				colvarFullVideoFile.IsReadOnly = false;
				colvarFullVideoFile.DefaultSetting = @"";
				colvarFullVideoFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarFullVideoFile);
				
				TableSchema.TableColumn colvarShortVideoFile = new TableSchema.TableColumn(schema);
				colvarShortVideoFile.ColumnName = "ShortVideoFile";
				colvarShortVideoFile.DataType = DbType.String;
				colvarShortVideoFile.MaxLength = 100;
				colvarShortVideoFile.AutoIncrement = false;
				colvarShortVideoFile.IsNullable = true;
				colvarShortVideoFile.IsPrimaryKey = false;
				colvarShortVideoFile.IsForeignKey = false;
				colvarShortVideoFile.IsReadOnly = false;
				colvarShortVideoFile.DefaultSetting = @"";
				colvarShortVideoFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarShortVideoFile);
				
				TableSchema.TableColumn colvarPressFile = new TableSchema.TableColumn(schema);
				colvarPressFile.ColumnName = "PressFile";
				colvarPressFile.DataType = DbType.String;
				colvarPressFile.MaxLength = 50;
				colvarPressFile.AutoIncrement = false;
				colvarPressFile.IsNullable = true;
				colvarPressFile.IsPrimaryKey = false;
				colvarPressFile.IsForeignKey = false;
				colvarPressFile.IsReadOnly = false;
				colvarPressFile.DefaultSetting = @"";
				colvarPressFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPressFile);
				
				TableSchema.TableColumn colvarOutDoorFile = new TableSchema.TableColumn(schema);
				colvarOutDoorFile.ColumnName = "OutDoorFile";
				colvarOutDoorFile.DataType = DbType.String;
				colvarOutDoorFile.MaxLength = 50;
				colvarOutDoorFile.AutoIncrement = false;
				colvarOutDoorFile.IsNullable = true;
				colvarOutDoorFile.IsPrimaryKey = false;
				colvarOutDoorFile.IsForeignKey = false;
				colvarOutDoorFile.IsReadOnly = false;
				colvarOutDoorFile.DefaultSetting = @"";
				colvarOutDoorFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOutDoorFile);
				
				TableSchema.TableColumn colvarRadioFile = new TableSchema.TableColumn(schema);
				colvarRadioFile.ColumnName = "RadioFile";
				colvarRadioFile.DataType = DbType.String;
				colvarRadioFile.MaxLength = 50;
				colvarRadioFile.AutoIncrement = false;
				colvarRadioFile.IsNullable = true;
				colvarRadioFile.IsPrimaryKey = false;
				colvarRadioFile.IsForeignKey = false;
				colvarRadioFile.IsReadOnly = false;
				colvarRadioFile.DefaultSetting = @"";
				colvarRadioFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRadioFile);
				
				TableSchema.TableColumn colvarCableFile = new TableSchema.TableColumn(schema);
				colvarCableFile.ColumnName = "CableFile";
				colvarCableFile.DataType = DbType.String;
				colvarCableFile.MaxLength = 50;
				colvarCableFile.AutoIncrement = false;
				colvarCableFile.IsNullable = true;
				colvarCableFile.IsPrimaryKey = false;
				colvarCableFile.IsForeignKey = false;
				colvarCableFile.IsReadOnly = false;
				colvarCableFile.DefaultSetting = @"";
				colvarCableFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCableFile);
				
				TableSchema.TableColumn colvarPricePerSecond = new TableSchema.TableColumn(schema);
				colvarPricePerSecond.ColumnName = "PricePerSecond";
				colvarPricePerSecond.DataType = DbType.Double;
				colvarPricePerSecond.MaxLength = 0;
				colvarPricePerSecond.AutoIncrement = false;
				colvarPricePerSecond.IsNullable = false;
				colvarPricePerSecond.IsPrimaryKey = false;
				colvarPricePerSecond.IsForeignKey = false;
				colvarPricePerSecond.IsReadOnly = false;
				
						colvarPricePerSecond.DefaultSetting = @"((0))";
				colvarPricePerSecond.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPricePerSecond);
				
				TableSchema.TableColumn colvarDuration = new TableSchema.TableColumn(schema);
				colvarDuration.ColumnName = "Duration";
				colvarDuration.DataType = DbType.Int32;
				colvarDuration.MaxLength = 0;
				colvarDuration.AutoIncrement = false;
				colvarDuration.IsNullable = false;
				colvarDuration.IsPrimaryKey = false;
				colvarDuration.IsForeignKey = false;
				colvarDuration.IsReadOnly = false;
				
						colvarDuration.DefaultSetting = @"((0))";
				colvarDuration.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDuration);
				
				TableSchema.TableColumn colvarMediaType = new TableSchema.TableColumn(schema);
				colvarMediaType.ColumnName = "MediaType";
				colvarMediaType.DataType = DbType.String;
				colvarMediaType.MaxLength = 5;
				colvarMediaType.AutoIncrement = false;
				colvarMediaType.IsNullable = true;
				colvarMediaType.IsPrimaryKey = false;
				colvarMediaType.IsForeignKey = false;
				colvarMediaType.IsReadOnly = false;
				colvarMediaType.DefaultSetting = @"";
				colvarMediaType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarMediaType);
				
				TableSchema.TableColumn colvarDateAdded = new TableSchema.TableColumn(schema);
				colvarDateAdded.ColumnName = "DateAdded";
				colvarDateAdded.DataType = DbType.DateTime;
				colvarDateAdded.MaxLength = 0;
				colvarDateAdded.AutoIncrement = false;
				colvarDateAdded.IsNullable = false;
				colvarDateAdded.IsPrimaryKey = false;
				colvarDateAdded.IsForeignKey = false;
				colvarDateAdded.IsReadOnly = false;
				
						colvarDateAdded.DefaultSetting = @"(getdate())";
				colvarDateAdded.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAdded);
				
				TableSchema.TableColumn colvarDateModified = new TableSchema.TableColumn(schema);
				colvarDateModified.ColumnName = "DateModified";
				colvarDateModified.DataType = DbType.DateTime;
				colvarDateModified.MaxLength = 0;
				colvarDateModified.AutoIncrement = false;
				colvarDateModified.IsNullable = false;
				colvarDateModified.IsPrimaryKey = false;
				colvarDateModified.IsForeignKey = false;
				colvarDateModified.IsReadOnly = false;
				
						colvarDateModified.DefaultSetting = @"(getdate())";
				colvarDateModified.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateModified);
				
				TableSchema.TableColumn colvarDateAddedTv = new TableSchema.TableColumn(schema);
				colvarDateAddedTv.ColumnName = "DateAdded_TV";
				colvarDateAddedTv.DataType = DbType.DateTime;
				colvarDateAddedTv.MaxLength = 0;
				colvarDateAddedTv.AutoIncrement = false;
				colvarDateAddedTv.IsNullable = true;
				colvarDateAddedTv.IsPrimaryKey = false;
				colvarDateAddedTv.IsForeignKey = false;
				colvarDateAddedTv.IsReadOnly = false;
				colvarDateAddedTv.DefaultSetting = @"";
				colvarDateAddedTv.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAddedTv);
				
				TableSchema.TableColumn colvarDateAddedRd = new TableSchema.TableColumn(schema);
				colvarDateAddedRd.ColumnName = "DateAdded_RD";
				colvarDateAddedRd.DataType = DbType.DateTime;
				colvarDateAddedRd.MaxLength = 0;
				colvarDateAddedRd.AutoIncrement = false;
				colvarDateAddedRd.IsNullable = true;
				colvarDateAddedRd.IsPrimaryKey = false;
				colvarDateAddedRd.IsForeignKey = false;
				colvarDateAddedRd.IsReadOnly = false;
				colvarDateAddedRd.DefaultSetting = @"";
				colvarDateAddedRd.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAddedRd);
				
				TableSchema.TableColumn colvarDateAddedCb = new TableSchema.TableColumn(schema);
				colvarDateAddedCb.ColumnName = "DateAdded_CB";
				colvarDateAddedCb.DataType = DbType.DateTime;
				colvarDateAddedCb.MaxLength = 0;
				colvarDateAddedCb.AutoIncrement = false;
				colvarDateAddedCb.IsNullable = true;
				colvarDateAddedCb.IsPrimaryKey = false;
				colvarDateAddedCb.IsForeignKey = false;
				colvarDateAddedCb.IsReadOnly = false;
				colvarDateAddedCb.DefaultSetting = @"";
				colvarDateAddedCb.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAddedCb);
				
				TableSchema.TableColumn colvarDateAddedPr = new TableSchema.TableColumn(schema);
				colvarDateAddedPr.ColumnName = "DateAdded_PR";
				colvarDateAddedPr.DataType = DbType.DateTime;
				colvarDateAddedPr.MaxLength = 0;
				colvarDateAddedPr.AutoIncrement = false;
				colvarDateAddedPr.IsNullable = true;
				colvarDateAddedPr.IsPrimaryKey = false;
				colvarDateAddedPr.IsForeignKey = false;
				colvarDateAddedPr.IsReadOnly = false;
				colvarDateAddedPr.DefaultSetting = @"";
				colvarDateAddedPr.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAddedPr);
				
				TableSchema.TableColumn colvarDateAddedOd = new TableSchema.TableColumn(schema);
				colvarDateAddedOd.ColumnName = "DateAdded_OD";
				colvarDateAddedOd.DataType = DbType.DateTime;
				colvarDateAddedOd.MaxLength = 0;
				colvarDateAddedOd.AutoIncrement = false;
				colvarDateAddedOd.IsNullable = true;
				colvarDateAddedOd.IsPrimaryKey = false;
				colvarDateAddedOd.IsForeignKey = false;
				colvarDateAddedOd.IsReadOnly = false;
				colvarDateAddedOd.DefaultSetting = @"";
				colvarDateAddedOd.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAddedOd);
				
				TableSchema.TableColumn colvarDateAddedNs = new TableSchema.TableColumn(schema);
				colvarDateAddedNs.ColumnName = "DateAdded_NS";
				colvarDateAddedNs.DataType = DbType.DateTime;
				colvarDateAddedNs.MaxLength = 0;
				colvarDateAddedNs.AutoIncrement = false;
				colvarDateAddedNs.IsNullable = true;
				colvarDateAddedNs.IsPrimaryKey = false;
				colvarDateAddedNs.IsForeignKey = false;
				colvarDateAddedNs.IsReadOnly = false;
				colvarDateAddedNs.DefaultSetting = @"";
				colvarDateAddedNs.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAddedNs);
				
				TableSchema.TableColumn colvarDateAddedIn = new TableSchema.TableColumn(schema);
				colvarDateAddedIn.ColumnName = "DateAdded_IN";
				colvarDateAddedIn.DataType = DbType.DateTime;
				colvarDateAddedIn.MaxLength = 0;
				colvarDateAddedIn.AutoIncrement = false;
				colvarDateAddedIn.IsNullable = true;
				colvarDateAddedIn.IsPrimaryKey = false;
				colvarDateAddedIn.IsForeignKey = false;
				colvarDateAddedIn.IsReadOnly = false;
				colvarDateAddedIn.DefaultSetting = @"";
				colvarDateAddedIn.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAddedIn);
				
				TableSchema.TableColumn colvarInternetFile = new TableSchema.TableColumn(schema);
				colvarInternetFile.ColumnName = "InternetFile";
				colvarInternetFile.DataType = DbType.String;
				colvarInternetFile.MaxLength = 50;
				colvarInternetFile.AutoIncrement = false;
				colvarInternetFile.IsNullable = true;
				colvarInternetFile.IsPrimaryKey = false;
				colvarInternetFile.IsForeignKey = false;
				colvarInternetFile.IsReadOnly = false;
				colvarInternetFile.DefaultSetting = @"";
				colvarInternetFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInternetFile);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["Adex"].AddSchema("ProdVersion",schema);
			}

		}

		#endregion
		
		#region Props
		
		  
		[XmlAttribute("ProdVersionID")]
		public int ProdVersionID 
		{
			get { return GetColumnValue<int>("ProdVersionID"); }

			set { SetColumnValue("ProdVersionID", value); }

		}

		  
		[XmlAttribute("ProdVersionCode")]
		public int ProdVersionCode 
		{
			get { return GetColumnValue<int>("ProdVersionCode"); }

			set { SetColumnValue("ProdVersionCode", value); }

		}

		  
		[XmlAttribute("ProdVersionName")]
		public string ProdVersionName 
		{
			get { return GetColumnValue<string>("ProdVersionName"); }

			set { SetColumnValue("ProdVersionName", value); }

		}

		  
		[XmlAttribute("BrandID")]
		public int? BrandID 
		{
			get { return GetColumnValue<int?>("BrandID"); }

			set { SetColumnValue("BrandID", value); }

		}

		  
		[XmlAttribute("ProductID")]
		public int? ProductID 
		{
			get { return GetColumnValue<int?>("ProductID"); }

			set { SetColumnValue("ProductID", value); }

		}

		  
		[XmlAttribute("FullVideo")]
		public bool FullVideo 
		{
			get { return GetColumnValue<bool>("FullVideo"); }

			set { SetColumnValue("FullVideo", value); }

		}

		  
		[XmlAttribute("ShortVideo")]
		public bool ShortVideo 
		{
			get { return GetColumnValue<bool>("ShortVideo"); }

			set { SetColumnValue("ShortVideo", value); }

		}

		  
		[XmlAttribute("FullVideoFile")]
		public string FullVideoFile 
		{
			get { return GetColumnValue<string>("FullVideoFile"); }

			set { SetColumnValue("FullVideoFile", value); }

		}

		  
		[XmlAttribute("ShortVideoFile")]
		public string ShortVideoFile 
		{
			get { return GetColumnValue<string>("ShortVideoFile"); }

			set { SetColumnValue("ShortVideoFile", value); }

		}

		  
		[XmlAttribute("PressFile")]
		public string PressFile 
		{
			get { return GetColumnValue<string>("PressFile"); }

			set { SetColumnValue("PressFile", value); }

		}

		  
		[XmlAttribute("OutDoorFile")]
		public string OutDoorFile 
		{
			get { return GetColumnValue<string>("OutDoorFile"); }

			set { SetColumnValue("OutDoorFile", value); }

		}

		  
		[XmlAttribute("RadioFile")]
		public string RadioFile 
		{
			get { return GetColumnValue<string>("RadioFile"); }

			set { SetColumnValue("RadioFile", value); }

		}

		  
		[XmlAttribute("CableFile")]
		public string CableFile 
		{
			get { return GetColumnValue<string>("CableFile"); }

			set { SetColumnValue("CableFile", value); }

		}

		  
		[XmlAttribute("PricePerSecond")]
		public double PricePerSecond 
		{
			get { return GetColumnValue<double>("PricePerSecond"); }

			set { SetColumnValue("PricePerSecond", value); }

		}

		  
		[XmlAttribute("Duration")]
		public int Duration 
		{
			get { return GetColumnValue<int>("Duration"); }

			set { SetColumnValue("Duration", value); }

		}

		  
		[XmlAttribute("MediaType")]
		public string MediaType 
		{
			get { return GetColumnValue<string>("MediaType"); }

			set { SetColumnValue("MediaType", value); }

		}

		  
		[XmlAttribute("DateAdded")]
		public DateTime DateAdded 
		{
			get { return GetColumnValue<DateTime>("DateAdded"); }

			set { SetColumnValue("DateAdded", value); }

		}

		  
		[XmlAttribute("DateModified")]
		public DateTime DateModified 
		{
			get { return GetColumnValue<DateTime>("DateModified"); }

			set { SetColumnValue("DateModified", value); }

		}

		  
		[XmlAttribute("DateAddedTv")]
		public DateTime? DateAddedTv 
		{
			get { return GetColumnValue<DateTime?>("DateAdded_TV"); }

			set { SetColumnValue("DateAdded_TV", value); }

		}

		  
		[XmlAttribute("DateAddedRd")]
		public DateTime? DateAddedRd 
		{
			get { return GetColumnValue<DateTime?>("DateAdded_RD"); }

			set { SetColumnValue("DateAdded_RD", value); }

		}

		  
		[XmlAttribute("DateAddedCb")]
		public DateTime? DateAddedCb 
		{
			get { return GetColumnValue<DateTime?>("DateAdded_CB"); }

			set { SetColumnValue("DateAdded_CB", value); }

		}

		  
		[XmlAttribute("DateAddedPr")]
		public DateTime? DateAddedPr 
		{
			get { return GetColumnValue<DateTime?>("DateAdded_PR"); }

			set { SetColumnValue("DateAdded_PR", value); }

		}

		  
		[XmlAttribute("DateAddedOd")]
		public DateTime? DateAddedOd 
		{
			get { return GetColumnValue<DateTime?>("DateAdded_OD"); }

			set { SetColumnValue("DateAdded_OD", value); }

		}

		  
		[XmlAttribute("DateAddedNs")]
		public DateTime? DateAddedNs 
		{
			get { return GetColumnValue<DateTime?>("DateAdded_NS"); }

			set { SetColumnValue("DateAdded_NS", value); }

		}

		  
		[XmlAttribute("DateAddedIn")]
		public DateTime? DateAddedIn 
		{
			get { return GetColumnValue<DateTime?>("DateAdded_IN"); }

			set { SetColumnValue("DateAdded_IN", value); }

		}

		  
		[XmlAttribute("InternetFile")]
		public string InternetFile 
		{
			get { return GetColumnValue<string>("InternetFile"); }

			set { SetColumnValue("InternetFile", value); }

		}

		
		#endregion
		
		
			
		
		#region ForeignKey Properties
		
		/// <summary>
		/// Returns a Brand ActiveRecord object related to this ProdVersion
		/// 
		/// </summary>
		public Adex.Brand Brand
		{
			get { return Adex.Brand.FetchByID(this.BrandID); }

			set { SetColumnValue("BrandID", value.BrandID); }

		}

		
		
		/// <summary>
		/// Returns a Product ActiveRecord object related to this ProdVersion
		/// 
		/// </summary>
		public Adex.Product Product
		{
			get { return Adex.Product.FetchByID(this.ProductID); }

			set { SetColumnValue("ProductID", value.ProductID); }

		}

		
		
		#endregion
		
		
		
		//no ManyToMany tables defined (0)
		
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(int varProdVersionCode,string varProdVersionName,int? varBrandID,int? varProductID,bool varFullVideo,bool varShortVideo,string varFullVideoFile,string varShortVideoFile,string varPressFile,string varOutDoorFile,string varRadioFile,string varCableFile,double varPricePerSecond,int varDuration,string varMediaType,DateTime varDateAdded,DateTime varDateModified,DateTime? varDateAddedTv,DateTime? varDateAddedRd,DateTime? varDateAddedCb,DateTime? varDateAddedPr,DateTime? varDateAddedOd,DateTime? varDateAddedNs,DateTime? varDateAddedIn,string varInternetFile)
		{
			ProdVersion item = new ProdVersion();
			
			item.ProdVersionCode = varProdVersionCode;
			
			item.ProdVersionName = varProdVersionName;
			
			item.BrandID = varBrandID;
			
			item.ProductID = varProductID;
			
			item.FullVideo = varFullVideo;
			
			item.ShortVideo = varShortVideo;
			
			item.FullVideoFile = varFullVideoFile;
			
			item.ShortVideoFile = varShortVideoFile;
			
			item.PressFile = varPressFile;
			
			item.OutDoorFile = varOutDoorFile;
			
			item.RadioFile = varRadioFile;
			
			item.CableFile = varCableFile;
			
			item.PricePerSecond = varPricePerSecond;
			
			item.Duration = varDuration;
			
			item.MediaType = varMediaType;
			
			item.DateAdded = varDateAdded;
			
			item.DateModified = varDateModified;
			
			item.DateAddedTv = varDateAddedTv;
			
			item.DateAddedRd = varDateAddedRd;
			
			item.DateAddedCb = varDateAddedCb;
			
			item.DateAddedPr = varDateAddedPr;
			
			item.DateAddedOd = varDateAddedOd;
			
			item.DateAddedNs = varDateAddedNs;
			
			item.DateAddedIn = varDateAddedIn;
			
			item.InternetFile = varInternetFile;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varProdVersionID,int varProdVersionCode,string varProdVersionName,int? varBrandID,int? varProductID,bool varFullVideo,bool varShortVideo,string varFullVideoFile,string varShortVideoFile,string varPressFile,string varOutDoorFile,string varRadioFile,string varCableFile,double varPricePerSecond,int varDuration,string varMediaType,DateTime varDateAdded,DateTime varDateModified,DateTime? varDateAddedTv,DateTime? varDateAddedRd,DateTime? varDateAddedCb,DateTime? varDateAddedPr,DateTime? varDateAddedOd,DateTime? varDateAddedNs,DateTime? varDateAddedIn,string varInternetFile)
		{
			ProdVersion item = new ProdVersion();
			
				item.ProdVersionID = varProdVersionID;
				
				item.ProdVersionCode = varProdVersionCode;
				
				item.ProdVersionName = varProdVersionName;
				
				item.BrandID = varBrandID;
				
				item.ProductID = varProductID;
				
				item.FullVideo = varFullVideo;
				
				item.ShortVideo = varShortVideo;
				
				item.FullVideoFile = varFullVideoFile;
				
				item.ShortVideoFile = varShortVideoFile;
				
				item.PressFile = varPressFile;
				
				item.OutDoorFile = varOutDoorFile;
				
				item.RadioFile = varRadioFile;
				
				item.CableFile = varCableFile;
				
				item.PricePerSecond = varPricePerSecond;
				
				item.Duration = varDuration;
				
				item.MediaType = varMediaType;
				
				item.DateAdded = varDateAdded;
				
				item.DateModified = varDateModified;
				
				item.DateAddedTv = varDateAddedTv;
				
				item.DateAddedRd = varDateAddedRd;
				
				item.DateAddedCb = varDateAddedCb;
				
				item.DateAddedPr = varDateAddedPr;
				
				item.DateAddedOd = varDateAddedOd;
				
				item.DateAddedNs = varDateAddedNs;
				
				item.DateAddedIn = varDateAddedIn;
				
				item.InternetFile = varInternetFile;
				
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		#endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string ProdVersionID = @"ProdVersionID";
			 public static string ProdVersionCode = @"ProdVersionCode";
			 public static string ProdVersionName = @"ProdVersionName";
			 public static string BrandID = @"BrandID";
			 public static string ProductID = @"ProductID";
			 public static string FullVideo = @"FullVideo";
			 public static string ShortVideo = @"ShortVideo";
			 public static string FullVideoFile = @"FullVideoFile";
			 public static string ShortVideoFile = @"ShortVideoFile";
			 public static string PressFile = @"PressFile";
			 public static string OutDoorFile = @"OutDoorFile";
			 public static string RadioFile = @"RadioFile";
			 public static string CableFile = @"CableFile";
			 public static string PricePerSecond = @"PricePerSecond";
			 public static string Duration = @"Duration";
			 public static string MediaType = @"MediaType";
			 public static string DateAdded = @"DateAdded";
			 public static string DateModified = @"DateModified";
			 public static string DateAddedTv = @"DateAdded_TV";
			 public static string DateAddedRd = @"DateAdded_RD";
			 public static string DateAddedCb = @"DateAdded_CB";
			 public static string DateAddedPr = @"DateAdded_PR";
			 public static string DateAddedOd = @"DateAdded_OD";
			 public static string DateAddedNs = @"DateAdded_NS";
			 public static string DateAddedIn = @"DateAdded_IN";
			 public static string InternetFile = @"InternetFile";
						
		}

		#endregion
	}

}

